import 'package:flutter/material.dart';
import 'package:myturngame/Theme.dart';
import 'package:myturngame/bean/game_map.dart';

WidgetBuilder mapDialogBuilder(Function(String) mapClick) {
  return (BuildContext context) {
// return object of type Dialog
    return Dialog(
      child: Padding(
        padding: const EdgeInsets.all(10),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: GameMap.maps
              .map(
                (e) => OutlinedButton(
                    onPressed: () {
                      mapClick(e);
                      Navigator.pop(context);
                    },
                    child: Text(
                      e,
                      style: textStyle,
                    )),
              )
              .toList(),
        ),
      ),
    );
  };
}
